package com.ruoyi.order.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.TbOrderMapper;
import com.ruoyi.order.domain.TbOrder;
import com.ruoyi.order.service.ITbOrderService;

/**
 * 订单Service业务层处理
 *
 * @author ruoyi
 * @date 2025-07-30
 */
@Service
public class TbOrderServiceImpl implements ITbOrderService {
    @Autowired
    private TbOrderMapper tbOrderMapper;

    /**
     * 查询订单
     *
     * @param orderId 订单主键
     * @return 订单
     */
    @Override
    public TbOrder selectTbOrderByOrderId(Long orderId) {
        return tbOrderMapper.selectTbOrderByOrderId(orderId);
    }

    /**
     * 查询订单列表
     *
     * @param tbOrder 订单
     * @return 订单
     */
    @Override
    public List<TbOrder> selectTbOrderList(TbOrder tbOrder) {
        return tbOrderMapper.selectTbOrderList(tbOrder);
    }

    /**
     * 新增订单
     *
     * @param tbOrder 订单
     * @return 结果
     */
    @Override
    public int insertTbOrder(TbOrder tbOrder) {
        return tbOrderMapper.insertTbOrder(tbOrder);
    }

    /**
     * 修改订单
     *
     * @param tbOrder 订单
     * @return 结果
     */
    @Override
    public int updateTbOrder(TbOrder tbOrder) {
        return tbOrderMapper.updateTbOrder(tbOrder);
    }

    /**
     * 批量删除订单
     *
     * @param orderIds 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteTbOrderByOrderIds(Long[] orderIds) {
        return tbOrderMapper.deleteTbOrderByOrderIds(orderIds);
    }

    /**
     * 删除订单信息
     *
     * @param orderId 订单主键
     * @return 结果
     */
    @Override
    public int deleteTbOrderByOrderId(Long orderId) {
        return tbOrderMapper.deleteTbOrderByOrderId(orderId);
    }
}
